package com.yfbao.web.gateway.config;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import lombok.Data;

import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;

@Configuration
@ConfigurationProperties(prefix = "fastapi")
@Data
public class FastApiProperties {
    private String baseUrl = "http://localhost:8008";
    private List<String> proxyPaths = Arrays.asList("/api");
//    private int connectTimeout = 5000;
//    private int socketTimeout = 30000;


    // 添加构造器确保List被正确初始化

    /**
     * 确保proxyPaths不为null
     */
    public List<String> getProxyPaths() {
        if (proxyPaths == null) {
            proxyPaths = new ArrayList<>();
        }
        return proxyPaths;
    }

    public void setProxyPaths(List<String> proxyPaths) {
        this.proxyPaths = proxyPaths != null ? proxyPaths : new ArrayList<>();
    }

}
